import type { AxiosRequestConfig } from "axios"
import { axiosTransform } from "./axiosTransform"

export interface RequestOptions {
  // 默认将prefix 添加到url
  joinPrefix?: boolean
  // 需要对返回数据进行处理
  isTransformRequestResult?: boolean
  // post请求的时候添加参数到url
  joinParamsToUrl?: boolean
  // 格式化提交参数时间
  formatDate?: boolean
  // 消息提示类型
  errorMessageMode?: "none" | "modal"
}

export interface Result<T = any> {
  status: number
  msg: string
  data: T
}
export interface AxiosRequestOpts extends AxiosRequestConfig {
  transform?: axiosTransform
  requestOptions?: RequestOptions
}
